package march.finalmarch21;

import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class FlowBean implements WritableComparable<FlowBean> {
    /**
     * 序号
     */
    private String id;

    /**
     * 行业
     */
    private String industry;

    /**
     * 项目类别
     */
    private String type;

    /**
     * 币种ID
     */
    private String coinId;

    /**
     * 贷款金额
     */
    private String loanAmount;

    /**
     * 实际提款额
     */
    private String drawMoneyAmount;

    /**
     * 已还本金额
     */
    private String repaidAmount;

    /**
     * 利息金额
     */
    private String interestAmount;

    /**
     * 币种名称
     */
    private String coinName;

    /**
     * 利率
     */
    private String exchangePrice;

    /**
     * 贷款金额（RMB）
     */
    private String loanRMB;

    /**
     * 实际提款额（RMB）
     */
    private String drawRMB;

    /**
     * 已还本金额（RMB）
     */
    private String repaidRMB;

    /**
     * 利息金额（RMB）
     */
    private String interestRMB;

    /**
     * 贷款余额（RMB）
     */
    private String balanceRMB;

    /**
     * 标识
     */
    private String flag;

    public FlowBean(){
//        this.id = "";
//        this.industry = "";
//        this.type = "";
//        this.coinId = "";
//        this.loanAmount = "";
//        this.drawMoneyAmount = "";
//        this.repaidAmount = "";
//        this.interestAmount = "";
//        this.exchangePrice = "";
//        this.coinName = "";
//        this.loanRMB = "";
//        this.drawRMB = "";
//        this.repaidRMB = "";
//        this.interestRMB = "";
//        this.balanceRMB = "";
//        this.flag = "";
    }


    public FlowBean(String flag,String id,String industry, String type, String coinId, String loanAmount, String drawMoneyAmount, String repaidAmount, String interestAmount, String coinName, String exchangePrice, String loanRMB, String drawRMB, String repaidRMB, String interestRMB, String balanceRMB) {
        this.id = id;
        this.industry = industry;
        this.type = type;
        this.coinId = coinId;
        this.loanAmount = loanAmount;
        this.drawMoneyAmount = drawMoneyAmount;
        this.repaidAmount = repaidAmount;
        this.interestAmount = interestAmount;
        this.coinName = coinName;
        this.exchangePrice = exchangePrice;
        this.loanRMB = loanRMB;
        this.drawRMB = drawRMB;
        this.repaidRMB = repaidRMB;
        this.interestRMB = interestRMB;
        this.balanceRMB = balanceRMB;
        this.flag = flag;
    }

    @Override
    public void write(DataOutput out) throws IOException{
        out.writeUTF(id);
        out.writeUTF(industry);
        out.writeUTF(type);
        out.writeUTF(coinId);
        out.writeUTF(loanAmount);
        out.writeUTF(drawMoneyAmount);
        out.writeUTF(repaidAmount);
        out.writeUTF(interestAmount);
        out.writeUTF(coinName);
        out.writeUTF(exchangePrice);
        out.writeUTF(loanRMB);
        out.writeUTF(drawRMB);
        out.writeUTF(repaidRMB);
        out.writeUTF(interestRMB);
        out.writeUTF(balanceRMB);
        out.writeUTF(flag);
    }


    @Override
    public void readFields(DataInput in) throws IOException {
        id = in.readUTF();
        industry = in.readUTF();
        type = in.readUTF();
        coinId = in.readUTF();
        loanAmount = in.readUTF();
        drawMoneyAmount = in.readUTF();
        repaidAmount = in.readUTF();
        interestAmount = in.readUTF();
        coinName = in.readUTF();
        exchangePrice = in.readUTF();
        drawRMB = in.readUTF();
        loanRMB = in.readUTF();
        repaidRMB = in.readUTF();
        interestRMB = in.readUTF();
        balanceRMB = in.readUTF();
        flag = in.readUTF();

    }


    @Override
    public String toString() {
        return
                id +
                "," + industry +
                "," + type +
                "," + coinId +
                "," + loanAmount +
                "," + drawMoneyAmount +
                "," + repaidAmount +
                "," + interestAmount +
                "," + coinName +
                "," + exchangePrice +
                "," + loanRMB +
                "," + drawRMB +
                "," + repaidRMB +
                "," + interestRMB +
                "," + balanceRMB +
                "," + flag
                ;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getExchangePrice() {
        return exchangePrice;
    }

    public void setExchangePrice(String exchangePrice) {
        this.exchangePrice = exchangePrice;
    }

    public String getIndustry() {
        return industry;
    }

    public void setIndustry(String industry) {
        this.industry = industry;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCoinId() {
        return coinId;
    }

    public void setCoinId(String coinId) {
        this.coinId = coinId;
    }

    public String getLoanAmount() {
        return loanAmount;
    }

    public void setLoanAmount(String loanAmount) {
        this.loanAmount = loanAmount;
    }

    public String getDrawMoneyAmount() {
        return drawMoneyAmount;
    }

    public void setDrawMoneyAmount(String drawMoneyAmount) {
        this.drawMoneyAmount = drawMoneyAmount;
    }

    public String getRepaidAmount() {
        return repaidAmount;
    }

    public void setRepaidAmount(String repaidAmount) {
        this.repaidAmount = repaidAmount;
    }

    public String getInterestAmount() {
        return interestAmount;
    }

    public void setInterestAmount(String interestAmount) {
        this.interestAmount = interestAmount;
    }

    public String getCoinName() {
        return coinName;
    }

    public void setCoinName(String coinName) {
        this.coinName = coinName;
    }

    public String getLoanRMB() {
        return loanRMB;
    }

    public void setLoanRMB(String loanRMB) {
        this.loanRMB = loanRMB;
    }

    public String getDrawRMB() {
        return drawRMB;
    }

    public void setDrawRMB(String drawRMB) {
        this.drawRMB = drawRMB;
    }

    public String getRepaidRMB() {
        return repaidRMB;
    }

    public void setRepaidRMB(String repaidRMB) {
        this.repaidRMB = repaidRMB;
    }

    public String getInterestRMB() {
        return interestRMB;
    }

    public void setInterestRMB(String interestRMB) {
        this.interestRMB = interestRMB;
    }

    public String getBalanceRMB() {
        return balanceRMB;
    }

    public void setBalanceRMB(String balanceRMB) {
        this.balanceRMB = balanceRMB;
    }


    @Override
    public int compareTo(FlowBean o) {
        return 0;
    }
}
